package com.ayoka.parenting.adapter;

import android.widget.ImageView;

import com.ayoka.parenting.R;
import com.ayoka.parenting.bean.CircleMemberBean;
import com.jincp.common.brvah.BaseQuickAdapter;
import com.jincp.common.brvah.BaseViewHolder;
import com.jincp.image.load.ImageLoader;
import com.jincp.image.load.ImageLoaderOptions;

/**
 * Created by jinchunping on 2018/4/11.
 */

public class CircleGroupMemberManageAdapter extends BaseQuickAdapter<CircleMemberBean, BaseViewHolder> {

    public CircleGroupMemberManageAdapter() {
        super(R.layout.item_circle_group_member_manage);
    }

    @Override
    protected void convert(BaseViewHolder holder, CircleMemberBean item) {
        if (item.UserInfo != null) {
            ImageLoader.getInstance().displayImage(item.UserInfo.LocalAvatar, (ImageView) holder.getView(R.id.iv_header), ImageLoaderOptions.getCircleOptions());
            holder.setText(R.id.tv_name, item.UserInfo.WeixinNickName);
        }
        holder.setText(R.id.tv_description, "加入时间" + item.CreateDate)
                .setVisible(R.id.ll_wait_confirm, item.Status == 0)
                .setVisible(R.id.btn_delete, item.Status == 1)
                .addOnClickListener(R.id.btn_agree)
                .addOnClickListener(R.id.btn_ignore)
                .addOnClickListener(R.id.btn_delete);
    }

}
